package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@ResponseBody
public class calcController {
    @RequestMapping("/calc")
    public String calc(@RequestParam("num1") Integer a, @RequestParam("num2") Integer b) {
        return "结果为：" + (a + b);
    }
}
